package org.xiaojinlong.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Jin Long
 * 2015/4/6.
 */
public class Application {

    public static void main(String[] args) {
//        ApplicationContext context =
//                new AnnotationConfigApplicationContext(Application.class);
//        MessagePrinter printer = context.getBean(MessagePrinter.class);
//        printer.printMessage();
        ApplicationContext context = new ClassPathXmlApplicationContext(
                "org/xiaojinlong/spring/spring-idol.xml"
        );

        Performer performer = (Performer) context.getBean("duke");
        performer.perform();
        TestA test = (TestA) context.getBean("testA");
        test.foo();
    }
}
